Assignment #124 Summing Three Numbers from a File

Code

      ///Name: Ian Grant
      ///Period:5
      ///Project Name: Summing Three Numbers from a File
      ///File Name:num3.java
      ///00/00/16
      
import java.io.File;
import java.util.Scanner;

public class nums3 {

    public static void main (String[] args) throws Exception {

        int a, b, c;

        Scanner fileIn = new Scanner(new File("Z://Comp//numbers.txt"));

        a = fileIn.nextInt();
        b = fileIn.nextInt();
        c = fileIn.nextInt();
        fileIn.close();

        System.out.println("done.");
        System.out.println(a + " + " + b + " + " + c + " = " + (a+b+c));
    }
}

      

Output